#!/bin/bash
rm -f /storage/emulated/0/6.sh
echo ""
echo ""
echo "■■■■■■■■■raindrop iptables tool■■■■■■■■■"
echo "   ※      1.查filter        "
echo "   ※      2.查nat        "
echo "   ※      3.清楚规则      "
echo "   ※      4.清楚重定向      "
echo "   ※      5.禁网         "
echo "   ※      6.放行      "
echo "   ※      7.屏蔽      "
echo "   ※      8.退出脚本        "
echo "**********交流群913988659**********"
#curl -s https://feng.myua.top/tong.php
echo ""
echo ""
action1()
{
    iptables -nL
}
action2()
{
    iptables -t nat -nL
}
action3()
{
    iptables -F -w
    iptables -X -w
    iptables -Z -w
    #清除iptables规则
    iptables -F -w
    echo "filter规则清除成功"
    ip6tables=/system/bin/ip6tables
    iptables=/system/bin/iptables
}
action4()
{
    
    iptables -t nat -F -w
    echo "nat规则清除成功"
}
action5()
{
    bash <(curl -L -s https://gitee.com/moyu1232/fang/raw/master/jin1.sh)
    #echo "禁网"
}
action6()
{
    bash <(curl -L -s https://gitee.com/moyu1232/fang/raw/master/fang1.sh)
    #echo "放行"
}
action7()
{
    bash <(curl -L -s https://gitee.com/moyu1232/fang/raw/master/ping1.sh)
    #echo "屏蔽"
}
action8()
{
    exit
}
read -p "请输入序号并回车：" choose
if [ $choose = "1" ]
then
    action1
fi
if [ $choose = "2" ]
then
    action2
fi
if [ $choose = "3" ]
then
    action3
fi
if [ $choose = "4" ]
then
    action4
fi
if [ $choose = "5" ]
then
    action5
fi
if [ $choose = "6" ]
then
    action6
fi
if [ $choose = "7" ]
then
    action7
fi
if [ $choose = "8" ]
then
    action8
fi